package poketrade;

import java.io.IOException;
import java.util.List;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import poketrade.entities.Carte;
import poketrade.managers.CardsManager;

/**
 * Servlet implementation class CardXmlLister
 */
@WebServlet("/CardXmlLister")
public class CardXmlLister extends BaseHttpServlet {
	private static final long serialVersionUID = 1L;
       
	@EJB
	private CardsManager cardsManager;
	
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Carte> cards = cardsManager.getCartes();
		request.setAttribute("cards", cards);
		forward(request, response, "/cardxmllister.jsp");
	}

}
